All Functions Used So Far, Week 3

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

sum

{base}

Get sum of numeric values or a vector

rm

{base}

Remove objects

cut

{base}

Convert Numeric to Factor

ylab

{GGPLOT2}

Label the y axis (ggplot)

install.packages

{base}

Install R package

ggplot

{GGPLOT2}

Create a ggplot graph

seq

{base}

Create a sequence

range

{base}

Return range of values

c

{base}

Combine values/vectors into a vector

levels

{base}

Get levels of a factor

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

order

{base}

Get indexes that will sort a vector

plot

{graphics}

Generic function from base R to produce a plot

ungroup

{dplyr}

Resolve grouping created with “group_by”

setwd

{base}

Set Working Directory

rbind

{base}

Combine R objects by rows

nrow

{base}

Get number of rows of a data frame

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

desc

{dplyr}

Arrange in descending order

which.max

{base}

return index of the largest value in a vector

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

labs

{GGPLOT2}

Customise labels in GGPLOT2

attach

{base}

Attach Set of R Objects to Search Path

grid.arrange

{gridExtra}

Places graphical objects into a rectangular grid

View

{base}

View a data frame

runif

{stats}

Draws ranndom numbers from the uniform distribution

median

{stats}

Get median of a vector

unique

{base}

get unique elements

sample

{base}

Takes a sample of the specified size

summary

{base}

Obtain summary statistics or detailed regression output

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

var

{stats}

Calculate variance

head

{utils}

Show first 5 rows of a data frame

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

mean

{base}

Get mean of a vector

factor

{base}

Create a factor

xlab

{GGPLOT2}

Label the x axis (ggplot)

recode

{dplyr}

Recode a variable

filter

{dplyr}

Filter out rows of a data frame according to logical vector

select

{dplyr}

Select columns from a tibble/data frame

read.spss

{foreign}

Read a .sav file (SPSS data)

round

{base}

Rounds numbers

set.seed

{base}

Initialise a pseudorandom number generator.

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

pie

{graphics}

Creates a basic pie chart

mutate

{dplyr}

Modify/create a column in a data frame

matrix

{base}

Creates a matrix from the given set of values.

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

lprop

{questionr}

Display row percentages of a two-way frequency table

ifelse

{base}

Return a or b depending on the value of test

class

{base}

Retrieve class of an R object

dim

{base}

Get dimensions of a data frame

boxplot

{graphics}

Plot a simple box plot

after_stat

{GGPLOT2}

Control aesthetic evaluation. On the module used for displying percent

hist

{graphics}

Plot a simple histogram

get_mode

{rstatix}

Compute the mode in a given vector.

ordered

{dplyr}

Create an ordered factor

theme_bw

{GGPLOT2}

A black and white ggplot theme

geom_histogram

{GGPLOT2}

Generates a histogram

geom_bar

{GGPLOT2}

Generates a bar chart

tabulate

{base}

Counts the number of times each integer occurs in an integer-only vector

freq

{questionr}

Generate frequency tables

read_excel

{readxl}

Read an Excel file

rnorm

{base}

Generate random numbers from a normal distribution

slice

{dplyr}

Subset rows using their positions

rbeta

{stats}

Beta Random Number Generating Function

is.na

{base}

Check if a value is NA/elements of vector are NA

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

max

{base}

Get maximum of a vector

geom_density

{GGPLOT2}

Generates a density plot

min

{base}

Get minimum of a vector

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

cbind

{base}

Combine R objects by columns

library

{base}

Load an R package

sd

{stats}

Get standard deviation of a vector

ncol

{base}

Get number of columns of a data frame

names

{base}

Retrieve names of a list/vector

str

{utils}

Get the structure of an R object

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

The end!